<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>滨海基金 -主页</title>

<!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

<link href="./css/bootstrap.min.css" rel="stylesheet">
<link href="./css/font-awesome.min.css" rel="stylesheet">
<link href="./css/animate.min.css" rel="stylesheet">
<link href="./css/style.min.css" rel="stylesheet">
<script src="./js/jquery.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="./js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="./js/plugins/layer/layer.min.js"></script>
<script src="./js/hplus.min.js"></script>
<script src="./js/contabs.min.js" type="text/javascript"></script>
<script src="./js/plugins/pace/pace.min.js"></script>
<link href="css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<script src="js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="js/common.js"></script>


</head>

<body class="fixed-sidebar full-height-layout gray-bg"
	style="overflow: hidden">
	<div id="wrapper">
		<!--左侧导航开始-->
		<nav class="navbar-default navbar-static-side" role="navigation">
		<div class="nav-close">
			<i class="fa fa-times-circle"></i>
		</div>
		<div class="sidebar-collapse">
			<ul class="nav" id="side-menu">
				<li class="nav-header">
					<div class="dropdown profile-element">
						<span><img alt="image" width="80px" height="80px"
							src="${loginUser.picture}" class="img-circle"
							onerror="this.src='img/profile_small.jpg'" /></span> <span
							class="clear"> <a data-toggle="dropdown"
							class="dropdown-toggle" href="#"> <span class="clear">
									<span class="block m-t-xs"><strong class="font-bold"><c:out
												value="${loginUser.name }"></c:out></strong> &nbsp;&nbsp; <c:out
											value="${loginUser.position }"></c:out> <b class="caret"></b></span>
							</span>
						</a>
							<ul class="dropdown-menu animated fadeInRight m-t-xs">
								<li><a class="J_menuItem" href="userDetail.do?id=1">个人资料</a></li>
								<li><a class="J_menuItem"
									onclick="showModal(editPasswordModal)">修改密码</a></li>
								<li class="divider"></li>
								<li><a onclick="loginOff()">注销登录</a></li>
							</ul>
					</div>
					<div class="logo-element">滨</div>
				</li>
				<%-- <c:forEach var="menu" items="${menu }">
					<c:if test="${menu.isStart eq 1 and menu.status eq 0 }">
						<li><a href="#"> <c:if test="${menu.id eq 25 }">
									<i class="fa fa-home"></i>
								</c:if> <c:if test="${menu.id eq 37 }">
									<i class="fa fa-tv"></i>
								</c:if> <c:if test="${menu.id eq 40 }">
									<i class="fa fa-pie-chart"></i>
								</c:if> <c:if test="${menu.id eq 47 }">
									<i class="fa fa-map"></i>
								</c:if> <c:if test="${menu.id eq 49 }">
									<i class="fa fa-users"></i>
								</c:if> <c:if test="${menu.id eq 50 }">
									<i class="fa fa-sitemap"></i>
								</c:if> <c:if test="${menu.id eq 52 }">
									<i class="fa fa-share-alt"></i>
								</c:if> <c:if test="${menu.id eq 53 }">
									<i class="fa fa-calendar-o"></i>
								</c:if> <c:if test="${menu.id eq 54 }">
									<i class="fa fa-user"></i>
								</c:if> <c:if test="${menu.id eq 59 }">
									<i class="fa fa-gears"></i>
								</c:if> <c:if test="${menu.id eq 61 }">
									<i class="fa fa-cubes"></i>
								</c:if> <span class="nav-label">${menu.name }</span> <span
								class="fa arrow"></span>
						</a>
							<ul class="nav nav-second-level">
								<c:forEach var="menuChilds" items="${menu.childMenus }">
									<c:if
										test="${menuChilds.isStart eq 1 and menuChilds.status eq 0}">
										<c:if test="${menuChilds.id eq 79 }">
											<li><a class="J_menuItem" id="birthdayRemind"
												href="${menuChilds.href }">${menuChilds.name }</a></li>
										</c:if>
										<c:if test="${menuChilds.id eq 83 }">

										</c:if>
										<c:if test="${menuChilds.id ne 79 }">
											<li><a class="J_menuItem" href="${menuChilds.href }">${menuChilds.name }</a></li>
										</c:if>
									</c:if>
								</c:forEach>
							</ul></li>
					</c:if>
				</c:forEach>
				<li style="display: none;"><a class="J_menuItem"
					id="contractExpiring" href="toContractExpiringList.do">合同到期提醒</a></li>
				<li style="display: none;"><a id="indexPageId"
					class="J_menuItem" href="indexPage.do">首页</a></li> --%>
				<li><a href="#"><i class="fa fa-home"></i><span
						class="nav-label">个人中心</span><span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="trip.do?id=1">我的行程</a></li>
						<li><a class="J_menuItem" href="toNotice.do?id=0">通知列表</a></li>
						<li><a class="J_menuItem" href="toNotice.do?id=1">公告列表</a></li>
						<li><a class="J_menuItem" href="acquisition.do">工作日志</a></li>
						<li><a class="J_menuItem" href="personalWorkPlan.do?id=1">工作计划</a></li>
					</ul></li>
				<li><a href="#"><i class="fa fa-tv"></i><span
						class="nav-label">拜访定位</span><span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="toRegisterList.do">拜访定位列表</a></li>
						<c:if
							test="${loginUser.quarters ne 0 and loginUser.quarters ne 8 }">
							<li><a class="J_menuItem" href="toEmployeeRegister.do">员工拜访列表</a></li>
						</c:if>
					</ul></li>
				<li><a href="#"><i class="fa fa-pie-chart"></i><span
						class="nav-label">销售图表</span><span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<c:forEach var="menu" items="${menu }">
							<c:if
								test="${menu.id eq 93 and menu.isStart eq 1 and menu.status eq 0 }">

								<c:forEach var="menuChilds" items="${menu.childMenus }">
									<c:if
										test="${menuChilds.isStart eq 1 and menuChilds.status eq 0}">
										<li><a class="J_menuItem" href="${menuChilds.href }">${menuChilds.name }</a></li>
									</c:if>
								</c:forEach>
							</c:if>
						</c:forEach>
						<li><a class="J_menuItem" href="toMarketingObjectives.do">销售目标</a></li>
					</ul></li>
				<li><a href="#"><i class="fa fa-map"></i><span
						class="nav-label">市场活动</span><span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="toActivity.do">活动列表</a></li>
						<li><a class="J_menuItem" href="toTrainList.do">培训列表</a></li>
					</ul></li>
				<c:forEach var="menu" items="${menu }">
					<c:if
						test="${menu.id eq 51 and menu.isStart eq 1 and menu.status eq 0 }">
						<li><a href="#"><i class="fa fa-gears"></i><span
								class="nav-label">客户统计</span><span class="fa arrow"></span> </a>
							<ul class="nav nav-second-level">
								<c:forEach var="menuChilds" items="${menu.childMenus }">
									<c:if
										test="${menuChilds.isStart eq 1 and menuChilds.status eq 0}">
										<li><a class="J_menuItem" href="${menuChilds.href }">${menuChilds.name }</a></li>
									</c:if>
								</c:forEach>
							</ul></li>
					</c:if>
				</c:forEach>
				<li><a href="#"><i class="fa fa-sitemap"></i><span
						class="nav-label">客户管理</span> <span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="toCustomer.do">客户列表</a></li>
						<c:if test="${loginUser.quarters ne 0 and loginUser.quarters ne 8}">
							<li><a class="J_menuItem" href="toEmployeeInfo.do">员工列表</a></li>
						</c:if>
						<li><a class="J_menuItem" href="toReserveList.do">预约列表</a></li>
						<li><a class="J_menuItem" id="birthdayRemind"
							href="toCustomerBirthdayList.do">生日提醒</a></li>
						<c:forEach var="menu" items="${menu }">
							<c:if test="${menu.id eq 50}">
								<c:forEach var="menuChilds" items="${menu.childMenus }">
									<c:if
										test="${menuChilds.id eq 89 and menuChilds.isStart eq 1 and menuChilds.status eq 0}">
										<li><a class="J_menuItem" href="${menuChilds.href }">${menuChilds.name }</a></li>
									</c:if>
								</c:forEach>
							</c:if>
						</c:forEach>
					</ul></li>
				<li><a href="#"><i class="fa fa-share-alt"></i><span
						class="nav-label">机会管理</span><span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="toChanceList.do">机会列表</a></li>
					</ul></li>
				<li><a href="#"><i class="fa fa-calendar-o"></i><span
						class="nav-label">合同管理</span> <span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="toContractList.do">合同列表</a></li>
						<c:if
							test="${loginUser.quarters ne 0 and loginUser.quarters ne 8}">
							<li><a class="J_menuItem" href="toContractCheckList.do">合同审核</a></li>
							<li><a class="J_menuItem" href="toProductCheck.do">产品预约审核</a></li>
						</c:if>
						<li><a class="J_menuItem" href="toContractExpiringList.do">合同到期提醒</a></li>
						<li><a class="J_menuItem" href="toContractRebateList.do">合同返利提醒</a></li>
					</ul></li>
				<li><a href="#"><i class="fa fa-user"></i><span
						class="nav-label">企业通讯</span><span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="contactsList.do?id=1">通讯录</a></li>
					</ul></li>
				<li><a href="#"><i class="fa fa-cubes"></i><span
						class="nav-label">金融产品</span> <span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="toListProduct.do">产品列表</a></li>
						<li><a class="J_menuItem" href="toListInformation.do">信息披露</a></li>
					</ul></li>
					<li><a href="#"><i class="fa fa-home"></i><span
						class="nav-label">新闻资讯</span><span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="toNews.do">资讯列表</a></li>
					</ul></li>
				<li><a href="#"><i class="fa fa-home"></i><span
						class="nav-label">服务支持</span><span class="fa arrow"></span> </a>
					<ul class="nav nav-second-level">
						<li><a class="J_menuItem" href="toServiceSupportJsp.do">服务支持列表</a></li>
					</ul></li>
				<li style="display: none;"><a class="J_menuItem"
					id="contractExpiring" href="toContractExpiringList.do">合同到期提醒</a></li>
				<li style="display: none;"><a id="indexPageId"
					class="J_menuItem" href="indexPage.do">首页</a></li>

			</ul>
		</div>
		</nav>
		<!--左侧导航结束-->
		<!--右侧部分开始-->
		<div id="page-wrapper" class="gray-bg dashbard-1">
			<div class="row border-bottom">
				<nav class="navbar navbar-static-top" role="navigation"
					style="margin-bottom: 0">
				<div class="navbar-header">
					<a class="navbar-minimalize minimalize-styl-2 btn btn-primary "
						href="#"><i class="fa fa-bars"></i> </a>
					<h2>&nbsp;&nbsp;&nbsp;滨海基金企业客户关系管理系统</h2>
				</div>
				<c:if test="${isPower eq 1 }">
					<div style="float: right; margin: 10px;">
						<a class="btn btn-info" href="toIndexManage.do">进入后台</a>
					</div>
				</c:if> </nav>

			</div>
			<div class="row content-tabs">
				<button class="roll-nav roll-left J_tabLeft">
					<i class="fa fa-backward"></i>
				</button>
				<nav class="page-tabs J_menuTabs">
				<div class="page-tabs-content">
					<a class="active J_menuTab" data-id="#" onclick="clickName()">首页</a>
				</div>
				</nav>
				<button class="roll-nav roll-right J_tabRight">
					<i class="fa fa-forward"></i>
				</button>
				<div class="btn-group roll-nav roll-right">
					<button class="dropdown J_tabClose" data-toggle="dropdown">
						操作<span class="caret"></span>
					</button>
					<ul role="menu" class="dropdown-menu dropdown-menu-right">
						<li class="J_tabCloseAll"><a>关闭全部选项卡</a></li>
						<li class="J_tabCloseOther"><a>关闭其他选项卡</a></li>
					</ul>
				</div>
				<a onclick="loginOff()" class="roll-nav roll-right J_tabExit"><i
					class="fa fa fa-sign-out"></i> 注销</a>
			</div>
			<div class="row J_mainContent" id="content-main">
				<iframe class="J_iframe" name="iframe0" width="100%" height="100%"
					src="indexPage.do" frameborder="0" data-id="index_v2.html" seamless></iframe>
			</div>
		</div>
		<!--右侧部分结束-->
		<!--右侧边栏开始-->


	</div>
	<!--右侧边栏结束-->
	</div>

	<!--修改密码的模态层  -->
	<div class="modal fade  " id='editPasswordModal'>
		<div class="modal-dialog" style="width: 500px; height: 500px;">
			<div class="modal-content">
				<div class="modal-header">
					<button class="close" data-dismiss='modal'>×</button>
					<h2 class="modal-title" align="center">修改密码</h2>
				</div>

				<div class="modal-body" align="center">
					<form class="form-horizontal m-t" id="signupForm">
						<div class="form-group">
							<label class="col-sm-3 control-label">用户名：</label>
							<div class="col-sm-8">
								<input id="email" name="email" class="form-control" type="text"
									value="${loginUser.name }" disabled="disabled">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">账号：</label>
							<div class="col-sm-8">
								<input id="username" name="username" class="form-control"
									type="text" value="${loginUser.userCard }" disabled="disabled">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">原密码<span
								style="color: red;">*</span>：
							</label>
							<div class="col-sm-8">
								<input id="relpwd" name="relpwd" class="form-control"
									type="password">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">新密码<span
								style="color: red;">*</span>：
							</label>
							<div class="col-sm-8">
								<input id="password" name="password" class="form-control"
									type="password">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">确认新密码<span
								style="color: red;">*</span>：
							</label>
							<div class="col-sm-8">
								<input id="confirm_password" name="confirm_password"
									class="form-control" type="password"> <span
									style="text-align: left;" class="help-block m-b-none"><i
									class="fa fa-info-circle"></i> 请再次输入您的新密码</span>
							</div>
						</div>
					</form>
					<div class="modal-footer" align="center">
						<div align="center">
							<button class="btn btn-primary" id="btnSubmit" type="button">提交</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$("#btnSubmit").click(
			function() { //“登录”按钮单击事件
				//获取用户名称
				var relpwd = $("#relpwd").val();
				var password = $("#password").val();
				var confirm_password = $("#confirm_password").val();
				console.log(password)
				if (relpwd == null || relpwd == "") {
					swal("请重新输入原密码", "原密码不能为空", "error");
					return false;
				}
				if (password != confirm_password) {
					swal("请重新输入新密码与确认新密码", "新密码与确认新密码不一致", "error");
					return false;
				} else if (confirm_password != "" && password != ""
						&& password.length < 5) {
					swal("请重新输入新密码与确认新密码", "密码长度必须大于五位", "error");
					return false;
				}

				if (confirm_password != "" && password != "") {
					$.ajax({
						url : "changePassword.do",
						type : "post",
						data : {
							password : password,
							relpwd : relpwd
						},
						async : false,
						error : function(request) {
							swal("修改失败!", "密码修改提示!", "error");
						},
						success : function(data) {
							if (data == 1) {
								swal("修改成功", "修改密码提示", "success");
								closeModal(editPasswordModal)
								//  				location = "loginOff.do"
							} else if (data == 2) {
								swal("请重新输入原密码", "您输入的原密码不正确", "error");
							} else {
								swal("修改失败!", "密码修改提示!", "error");
							}
							$('#signupForm')[0].reset();
						}
					});
				} else {
					swal("请填写新密码", "新密码不能为空", "error");
				}
			});

	//注销
	function loginOff() {
		swal({
			title : "您确定要注销登录吗",
			text : "",
			type : "warning",
			showCancelButton : true,
			confirmButtonColor : "#DD6B55",
			confirmButtonText : "确定",
			cancelButtonText : "取消",
			closeOnConfirm : false
		}, function() {
			location.href = "loginOff.do";
		});
	}

	//显示modal
	function showModal(modal) {
		$(modal).modal("show");
	}
	//隐藏modal
	function closeModal(modal) {
		$(modal).modal("hide");
	}
	function clickName() {
		document.getElementById("indexPageId").click();
	}

	function triggerA(a) {
		a = $(a).trigger("click");
	}
	function triggerB() {
		location.reload();
	}
</script>
</html>